package cn.edu.scau.cmi.wusonglang.GUIController;

import java.net.URL;
import java.util.ResourceBundle;

import cn.edu.scau.cmi.wusonglang.objectAdapter.Adapter;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TextArea;

public class ObjectAdapterGUIController implements Initializable{

	@FXML
	private CheckBox checkChina;
	
	@FXML
	private CheckBox checkUSA;
	
	@FXML
	private TextArea textArea;
	
	@Override
	public void initialize(URL location, ResourceBundle resources) {
		checkChina.selectedProperty().addListener((obserVable,oldVable,newVable)->{
			if(newVable == true)
				checkUSA.setSelected(false);
			textArea.setText(new Adapter().get220Votage());
		});
		
		checkUSA.selectedProperty().addListener((obserVable,oldVable,newVable)->{
			if(newVable == true)
				checkChina.setSelected(false);
			textArea.setText(new Adapter().get110Votage());
		});
	}

}
